<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<body>
<p>This tests parsing invalid XHTML content in innerHTML. You should see PASS below:</p>
<p>createContextualFragment: <span id="createContextualFragment">FAIL</span></p>
<p>insertAdjacentHTML: <span id="insertAdjacentHTML">FAIL</span></p>
<p>innerHTML: <span id="innerHTML">FAIL</span></p>
<p>outerHTML: <span id="outerHTML">FAIL</span></p>
<script type="text/javascript">
<![CDATA[

var div = document.createElement('div');
document.body.appendChild(div);

var range = document.createRange();
range.selectNode(div);
try {
    range.createContextualFragment('<b>a<');
} catch (exception) {
    document.getElementById('createContextualFragment').textContent = 'PASS - ' + exception.name;
}

try {
    div.insertAdjacentHTML('afterBegin', '<b>a<')
} catch (exception) {
    document.getElementById('insertAdjacentHTML').textContent = 'PASS - ' + exception.name;
}

try {
    div.innerHTML = '<b>a<';
} catch (exception) {
    document.getElementById('innerHTML').textContent = 'PASS - ' + exception.name;
}

try {
    div.outerHTML = '<b>a<';
} catch (exception) {
    document.getElementById('outerHTML').textContent = 'PASS - ' + exception.name;
}

if (window.testRunner)
    testRunner.dumpAsText();

]]>
</script>
</body>
</html>